/*
 *
 *    Copyright (C) 2011 Freddy Barrera All Rights Reserved.
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
 *    as published by the Free Software Foundation; either version 3
 *    of the License, or Mozilla Public License any later version.
 *
 *    This program is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with this program; if not, write to the Free Software
 *    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
 *    USA.
 *
 *    Redistribution and use in source and binary forms, with or without
 *    modification, are permitted provided that the following conditions are
 *    met:
 *
 *    -Redistribution of source code must retain the above copyright notice,
 *     this list of conditions and the following disclaimer.
 *
 *    -Redistribution in binary form must reproduce the above copyright notice,
 *     this list of conditions and the following disclaimer in the documentation
 *     and/or other materials provided with the distribution.
 *
 *    Neither the name of Freddy Barrera or the names of contributors may
 *    be used to endorse or promote products derived from this software without
 *    specific prior written permission.
 *
 *    This software is provided "AS IS," without a warranty of any kind. ALL
 *    EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
 *    ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
 *    OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. Freddy Barrera
 *    AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
 *    AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
 *    DERIVATIVES. IN NO EVENT WILL Freddy Barrera OR ITS LICENSORS BE LIABLE
 *    FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
 *    CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND
 *    REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR
 *    INABILITY TO USE THIS SOFTWARE, EVEN IF Freddy HAS BEEN ADVISED OF THE
 *    POSSIBILITY OF SUCH DAMAGES.
 *
 *    You acknowledge that this software is not designed, licensed or intended
 *    for use in the design, construction, operation or maintenance of any
 *    nuclear facility.
 *
 *
 */

package mx.uacam.ermilo.ercu.data.dao;

import mx.uacam.ermilo.ercu.data.dao.hibernate.HibernateDAOFactory;
import mx.uacam.ermilo.ercu.data.dao.interfaces.AnexosDAO;
import mx.uacam.ermilo.ercu.data.dao.interfaces.CurriculumsDAO;
import mx.uacam.ermilo.ercu.data.dao.interfaces.EmpleadosDAO;
import mx.uacam.ermilo.ercu.data.dao.interfaces.EstadosDAO;
import mx.uacam.ermilo.ercu.data.dao.interfaces.ExperienciasLaboralesDAO;
import mx.uacam.ermilo.ercu.data.dao.interfaces.FormacionesAcademicasDAO;
import mx.uacam.ermilo.ercu.data.dao.interfaces.InstitucionesDAO;
import mx.uacam.ermilo.ercu.data.dao.interfaces.LugaresNacimientoDAO;
import mx.uacam.ermilo.ercu.data.dao.interfaces.ModulosDAO;
import mx.uacam.ermilo.ercu.data.dao.interfaces.MunicipiosDAO;
import mx.uacam.ermilo.ercu.data.dao.interfaces.NivelesDAO;
import mx.uacam.ermilo.ercu.data.dao.interfaces.OrganizacionesDAO;
import mx.uacam.ermilo.ercu.data.dao.interfaces.PermisosDAO;
import mx.uacam.ermilo.ercu.data.dao.interfaces.RolesDAO;
import mx.uacam.ermilo.ercu.data.dao.interfaces.TiposAnexosDAO;
import mx.uacam.ermilo.ercu.data.dao.interfaces.UsuariosDAO;

/**
 *
 * @author Freddy Barrera
 */
public abstract class DAOFactory {
    /**
     * Creates a standalone DAOFactory that returns unmanaged DAO
     * beans for use in any environment Hibernate has been configured
     * for. Uses HibernateUtil/SessionFactory and Hibernate context
     * propagation (CurrentSessionContext), thread-bound or transaction-bound,
     * and transaction scoped.
     */
    public static final Class HIBERNATE = HibernateDAOFactory.class;

   /**
    * Factory method for instantiation of concrete factories.
    * @param factory the class factory.
    * @return a DAO factory intance.
    */
    public static DAOFactory instance(final Class factory) {
        try {
            return (DAOFactory) factory.newInstance();
        } catch (Exception ex) {
            throw new RuntimeException("Couldn't create DAOFactory: "
                    + factory);
        }
    }

    /**
     * This method get a instance of AnexoDAO.
     * @return a instance of AnexoDAO.
     */
    public abstract AnexosDAO getAnexosDAO();

    /**
     * This method get a instance of CurriculumsDAO.
     * @return a instance of CurriculumsDAO.
     */
    public abstract CurriculumsDAO getCurriculumsDAO();

    /**
     * This method get a instance of EmpleadosDAO.
     * @return a instance of EmpleadosDAO.
     */
    public abstract EmpleadosDAO getEmpleadosDAO();

    /**
     * This method get a instance of EstadosDAO.
     * @return a instance of EstadosDAO.
     */
    public abstract EstadosDAO getEstadosDAO();

    /**
     * This method get a instance of ExperienciasLaboralesDAO.
     * @return a instance of ExperienciasLaboralesDAO.
     */
    public abstract ExperienciasLaboralesDAO getExperienciasLaboralesDAO();

    /**
     * This method get a instance of FormacionesAcademicasDAO.
     * @return a instance of FormacionesAcademicasDAO.
     */
    public abstract FormacionesAcademicasDAO getFormacionesAcademicasDAO();

    /**
     * This method get a instance of InstitucionesDAO.
     * @return a instance of InstitucionesDAO.
     */
    public abstract InstitucionesDAO getInstitucionesDAO();

    /**
     * This method get a instance of LugaresNacimientoDAO.
     * @return a instance of LugaresNacimientoDAO.
     */
    public abstract LugaresNacimientoDAO getLugaresNacimientoDAO();

    /**
     * This method get a instance of ModulosDAO.
     * @return a instance of ModulosDAO.
     */
    public abstract ModulosDAO getModulosDAO();

    /**
     * This method get a instance of MunicipiosDAO.
     * @return a instance of MunicipiosDAO.
     */
    public abstract MunicipiosDAO getMunicipiosDAO();

    /**
     * This method get a instance of NivelesDAO.
     * @return a instance of NivelesDAO.
     */
    public abstract NivelesDAO getNivelesDAO();

    /**
     * This method get a instance of OrganizacionesDAO.
     * @return a instance of OrganizacionesDAO.
     */
    public abstract OrganizacionesDAO getOrganizacionesDAO();

    /**
     * This method get a instance of PermisosDAO.
     * @return a instance of PermisosDAO.
     */
    public abstract PermisosDAO getPermisosDAO();

    /**
     * This method get a instance of RolesDAO.
     * @return a instance of RolesDAO.
     */
    public abstract RolesDAO getRolesDAO();

    /**
     * This method get a instance of TiposAnexosDAO.
     * @return a instance of TiposAnexosDAO.
     */
    public abstract TiposAnexosDAO getTiposAnexosDAO();

    /**
     * This method get a instance of UsuariosDAO.
     * @return a instance of UsuariosDAO.
     */
    public abstract UsuariosDAO getUsuariosDAO();
}
